#!/usr/bin/env bash
git fetch
git reset --hard master
git pull
mvn install -Dmaven.test.skip=true
cd target/
cp -r wangcai-0.0.1-SNAPSHOT.jar  wangcai.jar
PID=$(ps -ef | grep wangcai.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo "服务已关闭"
else
    kill -9  $PID
fi
nohup java -jar wangcai.jar  >output 2>&1 &

tail -f output



